package comp418.blingo;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.ObjectInputStream;

import messagePackage.QuestionMessage;
import android.util.Log;
/**
 * This is the reader used to get the question message from the server
 * @author liujingbang
 *
 */
public class QuestionSocketReader extends Thread {
    BufferedReader serverin;
    String obj;
    
    ObjectInputStream ObjectIS = null;
    QuestionMessage readMessage=null;
    @SuppressWarnings("unused")
    private QuestionSocketReader() {
        // ��ʹ�õĽ�����
    	
    }
    
    QuestionSocketReader(BufferedReader in) {
            serverin = in;

    }
    
    QuestionSocketReader(ObjectInputStream ObjectIS) {
        this.ObjectIS = ObjectIS;
        
    }
 
    public void run() {
        
            try {

				readMessage = (QuestionMessage)ObjectIS.readObject();
				
            } catch (IOException e) {
                e.printStackTrace();
            } catch (ClassNotFoundException e){
            } catch(Exception e){
            	e.printStackTrace();
            }
            

            try {
                QuestionSocketReader.sleep(500);
            } catch (InterruptedException e) {
                Log.i("Chat", "Thread�Д��e�`");
                e.printStackTrace();
            }// ��Ϣ0.2��
        
 
    }
}
 